//  Copyright (c) 2010 Google Inc. All rights reserved.
//
//  Redistribution and use in source and binary forms, with or without
//  modification, are permitted provided that the following conditions are
//  met:
//
//    * Redistributions of source code must retain the above copyright
//  notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
//  copyright notice, this list of conditions and the following disclaimer
//  in the documentation and/or other materials provided with the
//  distribution.
//    * Neither the name of Google Inc. nor the names of its
//  contributors may be used to endorse or promote products derived from
//  this software without specific prior written permission.
//
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
//  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
//  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
//  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
//  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
//  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
//  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
//  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//  Based on ILCrashReporter by Claus Broch.
/*

 COPYRIGHT AND PERMISSION NOTICE

 Portions Copyright (c) 2004 Claus Broch, Infinite Loop. All rights reserved.

 Permission to use, copy and distribute this software for any purpose
 with or without fee is hereby granted, provided that the above copyright
 notice and this permission notice appear in all copies.

 This Software is provided by Infinite Loop on an "AS IS" basis. INFINITE LOOP
 MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE, REGARDING THE INFINITE LOOP SOFTWARE OR ITS USE AND OPERATION ALONE OR
 IN COMBINATION WITH YOUR PRODUCTS.

 IN NO EVENT SHALL INFINITE LOOP BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
 AND/OR DISTRIBUTION OF THE INFINITE LOOP SOFTWARE, HOWEVER CAUSED AND WHETHER
 UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
 OTHERWISE, EVEN IF INFINITE LOOP HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 DAMAGE.

 Except as contained in this notice, the name of the copyright holder shall not
 be used in advertising or otherwise to promote the sale, use or other dealings
 in this Software without prior written authorization of the copyright holder.
*/

/*!
 @header CrashReporter
 @discussion
 The CrashReporter class enables developers to easily integrate crash reporting
 facilities into existing applications.<p>
 If the monitored application should crash or otherwise terminate unexpectedly
 a notification will appear allowing the user to provide additional
 information. If the user then elects to submit the report an email is sent
 directly to the address provided by the developer.
*/

#import <Foundation/Foundation.h>

/*!
  @class CrashReporter
  @abstract    Crash reporter task
  @discussion The CrashReporter class enables you to launch a background task
  that will monitor the launching application. If the application unexpectedly
  terminates the crash reporter will display a notification and allow the user
  to provide a description of the nature of the crash.<p>
  If the user desides to complete the crash report an email is sent containing
  the users description and the crashlog generated by the operating system.
*/
@interface CrashReporter : NSObject {
 @private
  NSTask* reporterTask_;
  NSString* companyName_;
  NSString* url_;
  NSString* userInfo_;
}

/*! The localized company name that will be displayed to the user in the crash
    report user interface, e.g. "Realmac Software".
*/
@property (copy) NSString* companyName;
/*! The url that the crash report will be posted to. */
@property (copy) NSString* url;
/*! This is an arbitrary string that will be embedded in the crash report email,
    as a "User Info:" field.  It's useful if you need to specify additional
    information in the crash report, e.g. a customer's ID number or registration
    code if you'd like to contact them.
*/
@property (copy) NSString* userInfo;


/*!
 @method     launchReporter
 @abstract   Launch the crash reporter task
 @discussion Launch the crash reporter task.  You should set at least the
             companyName and reportAddress properties for this to be useful.
*/
- (BOOL)launchReporter;


@end
